{{template "../public/page_header.html"}}

<div class="container-fluid">
    <div class="row">
        <div class="panel panel-default">
            <div class="panel-heading">
                <a href="/{{config "String" "adminPath" ""}}/productCate/add" class="btn btn-primary">增加商品分类</a>
            </div>

            <!--
                列表展示
            -->
            <div class="table-responsive">
                <table class="table table-bordered">
                    <thead>
                    <tr class="th">
                        <th>分类名称</th>
                        <th>分类图片</th>
                        <th class="text-center">排序</th>
                        <th class="text-center">状态</th>
                        <th class="text-center">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {{range $key,$value := .productCateList}}
                    <tr>
                        <td>{{$value.Title}}</td>
                        <td></td>
                        <td><span class="chSpanNum" data-id="{{$value.Id}}" data-table="product_cate" data-field="sort"
                                  data-num="{{$value.Sort}}">{{$value.Sort}}</span></td>
                        <td class="text-center">
                        {{if eq $value.Status 1}}
                            <img src="/static/backend/images/yes.gif" class="chStatus" data-id="{{$value.Id}}"
                                 data-table="product_cate" data-field="status"/>
                        {{else}}
                            <img src="/static/backend/images/no.gif" class="chStatus" data-id="{{$value.Id}}"
                                 data-table="product_cate" data-field="status"/>
                        {{end}}
                        </td>
                        <td class="text-center">　
                            <a href="/{{config "String" "adminPath" ""}}/productCate/edit?id={{$value.Id}}"/>修改</a> 　
                            <a class="delete"
                               href="/{{config "String" "adminPath" ""}}/productCate/delete?id={{$value.Id}}"/>删除</a>
                        </td>
                    </tr>
                    {{range $k,$v := $value.ProductCateItem}}
                    <tr>
                        <td>　　--{{$v.Title}}</td>
                        <td>
                            <!-- <img src="{{$v.CateImg | formatImage}}" /> -->
                            <div class="image">
                                <img src="{{$v.CateImg | formatImage}}"/>
                            </div>
                        </td>
                        <td class="text-center">
                            <span class="chSpanNum" data-id="{{$v.Id}}" data-table="product_cate" data-field="sort"
                                  data-num="{{$v.Sort}}">{{$v.Sort}}</span>
                        </td>
                        <td class="text-center">
                        {{if eq $v.Status 1}}
                            <img src="/static/backend/images/yes.gif" class="chStatus" data-id="{{$v.Id}}"
                                 data-table="product_cate" data-field="status"/>
                        {{else}}
                            <img src="/static/backend/images/no.gif" class="chStatus" data-id="{{$v.Id}}"
                                 data-table="product_cate" data-field="status"/>
                        {{end}}
                        </td>
                        <td class="text-center">　
                            <a href="/{{config "String" "adminPath" ""}}/productCate/edit?id={{$v.Id}}"/>修改</a> 　
                            <a class="delete"
                               href="/{{config "String" "adminPath" ""}}/productCate/delete?id={{$v.Id}}"/>删除</a>
                        </td>
                    </tr>
                    {{end}}
                    {{end}}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

</body>

<style>
    .image {
        width: 50px;
        height: 50px;
    }

    .image > img {
        width: 100%;
    }
</style>

</html>